//具体封装请求的方法
import request from "./axios";

//请求数据的方法
export const getIpData = () => {
  return request.get("/ip?key=5b966b5c3df8a7a21dc2a8897024e5d8");
};
//请求地理编码数据的方法
export const getAddressData = (address) => {
  return request.get(`/geocode/geo?key=5b966b5c3df8a7a21dc2a8897024e5d8&address=${address}`);
};
//请求天气数据的方法
export const getWeatherData = (code) => {
  return request.get(`/weather/weatherInfo?key=5b966b5c3df8a7a21dc2a8897024e5d8&city=${code}`);
};
//请求近期天气数据的方法
export const getWeatherAllData = (code) => {
  return request.get(`/weather/weatherInfo?key=5b966b5c3df8a7a21dc2a8897024e5d8&extensions=all&city=${code}`);
};